package com.tjsinfo.tjsoa.system.bo;

import java.util.ArrayList;
import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;

import com.tjsinfo.tjsoa.Dao.IQbcDao;
import com.tjsinfo.tjsoa.system.dao.ITSystemRolesGroupDAO;
import com.tjsinfo.tjsoa.system.vo.TSystemRolesGroup;

public class SystemRolesGroupBO implements ITSystemRolesGroupBO {
	private ITSystemRolesGroupDAO systemRolesGroupDAO;
	private IQbcDao qbcDao;
	
	public IQbcDao getQbcDao() {
		return qbcDao;
	}

	public void setQbcDao(IQbcDao qbcDao) {
		this.qbcDao = qbcDao;
	}

	public ITSystemRolesGroupDAO getSystemRolesGroupDAO() {
		return systemRolesGroupDAO;
	}

	public void setSystemRolesGroupDAO(ITSystemRolesGroupDAO systemRolesGroupDAO) {
		this.systemRolesGroupDAO = systemRolesGroupDAO;
	}

	public List<TSystemRolesGroup> selectRolesGroupPage(Integer first,
			Integer max) {
		// TODO Auto-generated method stub
		DetachedCriteria criteria = DetachedCriteria.forClass(TSystemRolesGroup.class);
		List<Order> list = new ArrayList<Order>();
		list.add(Order.asc("ordernumber"));
		return qbcDao.findPageByCriteria(criteria,list ,max, first).getItems();
	}

	public Integer selectRolesGroupTotalLine() {
		// TODO Auto-generated method stub
		DetachedCriteria criteria = DetachedCriteria.forClass(TSystemRolesGroup.class);
		return qbcDao.getQueryNumber(criteria, "id");
		
	}

	public List<TSystemRolesGroup> selectAllRolesGroup() {
		// TODO Auto-generated method stub
		DetachedCriteria criteria = DetachedCriteria.forClass(TSystemRolesGroup.class);
		return qbcDao.getCriteria(criteria);
	}

	public TSystemRolesGroup selectById(Integer rolesGroupId) {
		// TODO Auto-generated method stub
		return systemRolesGroupDAO.findById(rolesGroupId);
	}

}
